package cn.yunhe.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@Entity
@Table(name="loginuser")
public class LoginUser {
	private int loginuserid;
	private String loginusername;
	private String loginuserpassword;
	private Set<Essay> essays=new HashSet<Essay>();
	
	@Column(name="loginusername")
	public String getLoginusername() {
		return loginusername;
	}

	public void setLoginusername(String loginusername) {
		this.loginusername = loginusername;
	}
	@Column(name="loginuserpassword")
	public String getLoginuserpassword() {
		return loginuserpassword;
	}
	public void setLoginuserpassword(String loginuserpassword) {
		this.loginuserpassword = loginuserpassword;
	}
	public LoginUser() {
		super();
	}
	public LoginUser(String loginusername, String loginuserpassword) {
		super();
		this.loginusername = loginusername;
		this.loginuserpassword = loginuserpassword;
	}
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="loginuserid")
	public int getLoginuserid() {
		return loginuserid;
	}
	public void setLoginuserid(int loginuserid) {
		this.loginuserid = loginuserid;
	}
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.EAGER,mappedBy="loginuser")//mappedBy="loginuser"省略下边写法双向多对一配置
	/*@JoinColumn(name="loginuserid")*/
	public Set<Essay> getEssays() {
		return essays;
	}

	public void setEssays(Set<Essay> essays) {
		this.essays = essays;
	}
	
}
